﻿using HMEngine.HMComponents;
using Microsoft.Xna.Framework;

namespace HMEngine.HMCameras {
    public sealed class HMCameraManager : DrawableGameComponent {
        internal HMCameraManager(Game game) : base(game) { }
        private static HMCamera DefaultCamera { get; set; }
        public static HMCamera ActiveCamera { get; private set; }

        protected override void LoadContent() {
            DefaultCamera = new HMCamera(GraphicsDevice.Viewport);

            AddCamera("HMEngine.HMCameras.DefaultCamera", DefaultCamera);
            SetActiveCamera("HMEngine.HMCameras.DefaultCamera");

            base.LoadContent();
        }

        public static void AddCamera(string name, HMCamera camera) { HMComponentManager.AddComponent(name, camera); }

        public static void SetActiveCamera(string name) { ActiveCamera = HMComponentManager.GetComponent<HMCamera>(name); }
    }
}